<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>WiFi Configuration</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            background-color: #f4f4f4;
        }

        .container {
            background-color: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 400px;
            box-sizing: border-box;
        }

        h1 {
            font-size: 24px;
            margin-bottom: 20px;
            text-align: center;
        }

        input[type="text"],
        input[type="password"] {
            width: 100%;
            padding: 10px;
            margin: 10px 0;
            border: 1px solid #ccc;
            border-radius: 4px;
            box-sizing: border-box;
        }

        input[type="submit"] {
            width: 100%;
            background-color: #4CAF50;
            color: white;
            padding: 10px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
        }

        input[type="submit"]:hover {
            background-color: #45a049;
        }
        .option {
            display: inline-block;
            margin: 5px;
            padding: 10px;
            border: 1px solid #ccc;
            border-radius: 5px;
            cursor: pointer;
            background-color: #f9f9f9;
        }
        .option:active {
            background-color: #e0e0e0;
        }
    </style>
    <script>
        function fillInput(text) {
            document.getElementById('ssid').value = text;
        }
    </script>
</head>

<body>
    <div class="container">
        <form action="/config" method="post">
            <h1>WiFi Configuration</h1>
            <label for="ssid">SSID:</label>
            <input type="text" id="ssid" name="ssid" placeholder="Enter SSID" required><br>
            <div id="options">
            </div>
            <label for="password">Password:</label>
            <input type="password" id="password" name="password" placeholder="Enter Password" required><br>
            <h1>Device Configuration</h1>
            <label for="deviceName">Device Name:</label>
            <input type="text" id="deviceName" name="deviceName" value="" placeholder="Enter deviceName" required><br>
            <h1>MQTT Configuration</h1>
            <label for="server">Server:</label>
            <input type="text" id="server" name="server" value="192.168.10.2" placeholder="Enter Server" required><br>
            <label for="port">Port:</label>
            <input type="text" id="port" name="port" value="1883" placeholder="Enter Port" required><br>
            <label for="user">User:</label>
            <input type="text" id="user" name="user" value="esp32" placeholder="Enter User" required><br>
            <label for="pwd">Password:</label>
            <input type="text" id="pwd" name="pwd" value="123456" placeholder="Enter Password" required><br>
            <input type="submit" value="Save">
        </form>
    </div>
</body>

</html>